	<div class="column half fl">
		
		<div class="box themed_box">
		<h2 class="box-header"><?php echo $title; ?></h2>

		<div class="box-content">
        <?php echo $this->session->flashdata('message'); ?>
		
        
        
        <form id="formtest" name="formtest" method="post" action="<?php echo site_url($form['action']); ?>">
            <?php if($table['value']<>"") { ?>
            <input type="hidden" name="id" value="<?php echo $table['value']['id']; ?>" />
            <?php } ?>
            
			<label class="form-label"><?php echo $this->lang->line('date'); ?></label>
			<input name="date" class="form-field datepicker" type="text" value="<?php if($table['value']<>"") { echo $table['value']['activity_date']; } else { echo date('Y-m-d');  } ?>" />
			
            <?php if($this->session->userdata('user_group')==$this->config->item('admin')): ?>
            <label class="form-label"><?php echo $this->lang->line('time'); ?>(hh:mm:ss)</label>
			<input name="hour" class="form-field width5 timepicker" type="text"   value="<?php if($table['value']<>"") { echo substr($table['value']['activity_time'],0,2); } else { echo '09'; } ?>" />
			:
            <input name="minute" class="form-field width5 timepicker" type="text" value="<?php if($table['value']<>"") { echo substr($table['value']['activity_time'],3,2); }  else { echo '00'; }?>" />
            :
            <input name="second" class="form-field width5 timepicker" type="text" value="<?php if($table['value']<>"") { echo substr($table['value']['activity_time'],6,2); }  else { echo '00'; } ?>" />
            <?php endif;?>
            <label class="form-label"><?php echo $this->lang->line('customers'); ?></label>
            <input id="customer" class="form-field width60" name="customer" type="text" value="<?php if($table['value']<>"") { echo $table['value']['customer_name']; } ?>" maxlength="100"/>
            <div id="box-con" class="dialog" title="<?php echo $this->lang->line('users'); ?>">
			    <table class="display" id="tabledata">
            	<thead>
            		<tr>
            			<th><?php echo $this->lang->line('id');?></th>
            			<th><?php echo $this->lang->line('customer_name');?></th>
						<th><?php echo $this->lang->line('status');?></th>
                        <th><?php echo $this->lang->line('ta');?></th>
                        <th><?php echo $this->lang->line('se');?></th>
						<th><?php echo $this->lang->line('ae');?></th>
						<th>Add</th>
            		</tr>
            	</thead>
                	<tbody>
                	<?php foreach($table['customers'] as $rec): ?>
                		<tr class="gradeX">
                
                			<td><?php echo $rec['id'];?></td>
                			<td><?php echo $rec['customer_name'];?></td>
							<td><?php echo $rec['status_name'];?></td>
                            <td><?php echo $rec['rev'];?></td>
                            <td><?php echo $rec['rev2'];?></td>
							<td><?php echo $rec['rev3'];?></td>
							<td><a class="button themed closer" href="#" onclick="changeBgr('<?php echo $rec['customer_name'];?>')" ><?php echo $this->lang->line('add_list'); ?></a></td>
                		</tr>
                	<?php endforeach;?>	
                	</tbody>
	           </table>
                <p class="fr">
				<a class="button white">cancel</a>
				<a class="button themed closer">ok</a>
				</p>

            </div>
            
            <a class="button themed opener"><?php echo $this->lang->line('search_cust')?></a>
            
            <?php if($this->session->userdata('user_group')==$this->config->item('admin_dna')): ?>
               <label class="form-label">DNA <?php echo $this->lang->line('pic'); ?> (Special For DNA Users(Admin DNA Only))</label>
            <select id="select" name="user_dna" title="Select a category">
                    <option value="<?php if($table['value']<>"") { echo $table['value']['pic']; } ?>" ><?php if($table['value']<>"") { echo $table['value']['pic']; } ?></option>
    			<?php foreach($table['user_dna'] as $rowdna): ?>
                    <option value="<?php echo $rowdna['username']; ?>"><?php echo $rowdna['username']; ?></option>
                <?php endforeach;?>
            </select> 
            <?php endif; ?>
            
            <label class="form-label"><?php echo $this->lang->line('type'); ?></label>
            <select id="select" name="type" title="Select a category">
                    <option value="<?php if($table['value']<>"") { echo $table['value']['activity_id']; } ?>" ><?php if($table['value']<>"") { echo $table['value']['activity_type']; } ?></option>
    			<?php foreach($table['type'] as $rowtype): ?>
                    <option value="<?php echo $rowtype['id']; ?>"><?php echo $rowtype['activity_type']; ?></option>
                <?php endforeach;?>
            </select>            
            <!--
            <label class="form-label"><?php echo $this->lang->line('contact'); ?></label>
			<input id="form-tlp" class="form-field width60" name="contact" type="text" value="<?php if($table['value']<>"") { echo $table['value']['activity_contact']; } ?>" maxlength="100"/>
            -->
            <br/>
            <label class="form-label required"><?php echo $this->lang->line('location'); ?></label>
			<input id="form-location" class="form-field width60" name="location" type="text" value="<?php if($table['value']<>"") { echo $table['value']['pic']; } ?>" maxlength="100"/>
			
            <label class="form-label required"><?php echo $this->lang->line('people'); ?></label>
			<input id="form-people" class="form-field width60" name="people" type="text" value="<?php if($table['value']<>"") { echo $table['value']['activity_people']; } ?>" maxlength="100"/>
			
            <label class="form-label required"><?php echo $this->lang->line('objective'); ?></label>
			<input id="form-objective" class="form-field width60" name="objective" type="text" value="<?php if($table['value']<>"") { echo $table['value']['activity_objective']; } ?>" maxlength="100"/>
			
            <label class="form-label required"><?php echo $this->lang->line('result'); ?></label>
			<input id="form-result" class="form-field width60" name="result" type="text" value="<?php if($table['value']<>"") { echo $table['value']['activity_result']; } ?>" maxlength="100"/>
			
            <label class="form-label required"><?php echo $this->lang->line('follow_up'); ?></label>
			<input id="form-follow_up" class="form-field width60" name="follow_up" type="text" value="<?php if($table['value']<>"") { echo $table['value']['activity_follow_up']; } ?>" maxlength="100"/>
			
            <label class="form-label"><?php echo $this->lang->line('desc'); ?></label>
			<textarea id="form-message" class="form-field width90" name="desc" cols="" rows="2"><?php if($table['value']<>"") { echo $table['value']['activity_desc']; } ?></textarea>
			
			<input id="reset" class="button red" type="button" value="Reset" name="reset" />
			<input id="validate" class="button themed" type="submit" value="<?php echo $this->lang->line('save');?>" name="save" />
		</form>
		</div>

		</div>	
			
	</div>

	
	<div class="column half fr">
		<div class="box themed_box">

		<h2 class="box-header-new"></h2>
		<h2 class="box-header"><?php echo $this->lang->line('type'); ?></h2>
			
			<div class="box-content box-table">
			
            <?php echo $this->session->flashdata('message2'); ?>
            
			<table class="tablebox">
				<thead class="table-header">
					<tr>
						<th><?php echo $this->lang->line('type'); ?></th>
						<th><?php echo 'Target'; ?></th>
						<th class="tc"></th>
					</tr>
				</thead>
				
				<tbody class="openable-tbody">
                    <?php $i=1; ?>
					<?php foreach($table['type'] as $rec): ?>
                    <?php if($i % 2 == 0): 
                            $zebra="odd";
                          else: 
                            $zebra="even";
                          endif;
                    ?>
                    <tr class="<?php echo $zebra;?>">
						<td class="width80">
							<h5><?php echo $rec['activity_type']; ?></h5>
		
						</td>
						<td class="tc">
							<?php echo $rec['target']; ?>
						</td>
						<td class="tc">
                        <?php if($this->session->userdata('user_group')== $this->config->item('admin') ): ?>
						<a class="button themed openable"><span class="icon_single extend"></span></a>
                        <?php endif;?>
						</td>
					</tr>
                    
					<tr class="odd openable-tr">
						<?php echo form_open($this->config->item('actvtype_upd')); ?>
                        <td colspan="4">
							<div class="fl typo">
							<b><?php $this->config->item('pos'); ?></b>
							<p class="p_justify">
                              <input id="form-id" name="id" type="hidden" value="<?php echo $rec['id']; ?>" />
							  <input id="form-name" class="form-field width150" name="name" type="text" value="<?php echo $rec['activity_type']; ?>" maxlength="200"/>
							</p>
							</div>

							<div class="fl typo">
								<b>Target </b>
								<input id="form-target" class="form-field width150" name="target" type="text" value="<?php echo $rec['target']; ?>" maxlength="200"/>
							</div>

							
							<div class="s_3"></div>
							
							<div class="fl typo">
								<b>Published date: </b>
                                <?php if($rec['date_stamp']=='0000-00-00'): ?>
                                    -
                                <?php else: ?>
								<a href="#"><?php echo $rec['date_stamp']; ?></a>
                                <?php endif; ?> 
							</div>
						
							<div class="fr">
								 <input id="validate" class="button themed" type="submit" value="<?php echo $this->lang->line('delete');?>" name="delete" />
								 <input id="validate" class="button themed" type="submit" value="<?php echo $this->lang->line('save');?>" name="save" />
							</div>
						<?php echo form_close();?>
						<div class="clear"></div>
						</td>
					</tr>
                    <?php $i++; endforeach;?>
					
                    <tr>
						<td class="width80">
                           <?php if($this->session->userdata('user_group')== $this->config->item('admin') ): ?>
							<h5><?php echo $this->lang->line('add'); ?></h5>
		                  <?php endif;?>
						</td>
						<td class="tc">

							
						</td>
						<td class="tc">
                        <?php if($this->session->userdata('user_group')== $this->config->item('admin') ): ?>
						<a class="button themed openable"><span class="icon_single extend"></span></a>
                        <?php endif;?>
						</td>
					</tr>
                    
					<tr class="odd openable-tr">
						<td colspan="4">
                        <?php echo form_open($this->config->item('actvtype_save')); ?>
							<div class="fl typo">
							<b><?php $this->config->item('type'); ?></b>
							<p class="p_justify">
							  <input id="form-name" class="form-field width150" name="name" type="text" value="" maxlength="200"/>
							</p>
							</div>

							<div class="s_3"></div>
							
												
							<div class="fr">
								<input id="validate" class="button themed" type="submit" value="<?php echo $this->lang->line('save');?>" name="save" />
							</div>
						
						<div class="clear"></div>
                        <?php echo form_close();?>
						</td>
					</tr>
                    
				</tbody>
			</table>
            <!--
				<ul class="pagination">
				<li><a class="button white" href="#">previous</a></li>

				<li><a class="button white" href="#">1</a></li>
				<li><a class="button white" href="#">2</a></li>
				<li><a class="button white active" href="#">3</a></li>
				<li><a class="button white" href="#">4</a></li>
				<li><a class="button white" href="#">5</a></li>
				<li><a class="button white" href="#">6</a></li>

				<li><a class="button white" href="#">next</a></li>
				</ul>
              -->  
			</div>
		</div>			
	</div>
    
<script type="text/javascript">
    function changeBgr(isi) {
    document.formtest.customer.value = isi;
    document.getElementById('box-con').style.display = 'none';
    } 
</script>